#pragma once
#include "opencv.h"
#define  BGhmin -1.2
#define  BGhmax -1.2
#define  BGvmin 0.76
#define  BGvmax 0.76
#define  BRmin 0.973
#define  BRmax 1.55
#define  GRmin 0.104
#define  GRmax 0.476

class selfAdaptionSkin
{
public:
	selfAdaptionSkin(void);
	~selfAdaptionSkin(void);
	void skinDetectLC(Mat& _img, Mat& _mask);
	float findFitnessMask(Mat& _img, Mat& _mask,
		float&_BGhmin,  float&_BGhmax,
		float&_BGvmin, float&_BGvmax,
		float&_BRmin, float&_BRmax, 
		float&_GRmin, float&_GRmax);

	float findFitnessROI(Mat& _img, Rect& _ROI,
		float&_BGhmin,  float&_BGhmax, 
		float&_BGvmin, float&_BGvmax,
		float&_BRmin, float&_BRmax, 
		float&_GRmin, float&_GRmax);


	void getBestParamentMask(Mat& _img, Mat& _mask);

	void getBestParamentROI(Mat& _img, Rect& _ROI);



	float BGhminBest;
	float BGhmaxBest;
	float BGvminBest;
	float BGvmaxBest;
	float BRminBest;
	float BRmaxBest;
	float GRminBest;
	float GRmaxBest;


	float BGhminOR;
	float BGhmaxOR;
	float BGvminOR;
	float BGvmaxOR;
	float BRminOR;
	float BRmaxOR;
	float GRminOR;
	float GRmaxOR;



};

